package me.helllp.dake.generator.meta.core;

import javax.lang.model.element.Modifier;

import com.squareup.javapoet.FieldSpec;

import lombok.Getter;
import lombok.Setter;

/**
 * 字段信息
 * 
 * @author 林晓明
 *
 */
@Getter
@Setter
public class SmartField{
	/**
	 * 类型信息
	 */
	private SmartType type;
	
	/**
	 * 名称
	 */
	private String name;
	
	/**
	 * 描述
	 */
	private String desc;

	public SmartField(SmartType type, String name, String desc) {
		this.type = type;
		this.name = name;
		this.desc = desc;
	}

	public FieldSpec.Builder builder() {
		return FieldSpec.builder(type.build(), name, Modifier.PRIVATE).addJavadoc(desc);
	}
}
